<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #root {
            width: 300px;
            height: 400px;
            border: 1px solid red;
            position: absolute;
            right: 2px;
            bottom: 2px;
        }

        button {
            background: none;
            border: none;
            position: absolute;
            right: 5px;
            font-size: 20px;
            top: 5px;
        }

        button:hover {
            color: red;
        }

        h1 {
            text-align: center;
            margin-top: 150px;
        }
    </style>

</head>
<body>
<div id="root">
    <button onclick="x()">×</button>
    <h1>这是广告</h1>
</div>
<script>
    function x() {
        root.style.display = "none"
        setTimeout(() => {
            root.style.display = "block"
        }, 3000)
    }
</script>

</body>
</html>